package com.example.music.mapper;

import com.example.music.model.Music;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface LoveMusicMapper {
    /**
     * 检查是否已经收藏过该⾳乐
     * @param userId
     * @param musicId
     * @return
     */
    Music findLoveMusicByMusicIdAndUserId(int userId, int musicId);
    /**
     * 点赞/收藏⾳乐
     * @param userId
     * @param musicId
     * @return
     */
    boolean insertLoveMusic(int userId, int musicId);
    /**
     *根据歌曲名字，查询⾳乐
     * @param name
     * @return
     */
    List<Music> findLoveMusicBykeyAndUID(String musicName,int userId);
    /**
     查询所有的⾳乐
     @return
     */
    List<Music> findLoveMusicByUserId(int userId);
    Boolean deleteLoveMusic(int musicId,int userId);
    Boolean deleteLoveMusicById(int musicId);
}
